import { useContext } from 'react';
import { AudioChatServiceContext } from '@/components/AudioChatServiceProvider/context';

const speakerOptions = [
  { label: '爽快思思', value: 'zh_female_shuangkuaisisi_moon_bigtts' },
  { label: '温暖阿虎', value: 'zh_male_wennuanahu_moon_bigtts' },
];

export const useSpeakerConfig = () => {
  const { configNeedUpdateRef, currentSpeaker, setCurrentSpeaker } =
    useContext(AudioChatServiceContext);

  return {
    currentSpeaker,
    updateCurrentSpeaker: (v: string) => {
      setCurrentSpeaker(v);
      configNeedUpdateRef.current = true;
    },
    speakerOptions,
  };
};
